package com.hsc.www.amqp;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserSender {
    @Autowired
    private RabbitTemplate template;

    public void send(String routingKey, String  message) {
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        template.convertAndSend("123456",routingKey, message);
        System.out.println("发送：" + message);
    }
}